//
//  AppDelegateManager.m
//  Cat
//
//  Created by lushitong on 2018/11/29.
//  Copyright © 2018年 lushitong. All rights reserved.
//

#import "AppDelegateManager.h"
#import "FLRequest.h"
#import <IQKeyboardManager.h>
#import "ShareManager.h"
#import "SearchView.h"
#import "QKShareLiveSheetManager.h"
#import "QKShareLiveSheetManager.h"
#import <UMCommon/UMCommon.h>

@implementation AppDelegateManager

+ (void)operateWhenAppFinishLaunching {
	[FLRequest openLog];
	[ShareManager initUMShareConfig];
	[IQKeyboardManager sharedManager].enable = YES;
	bg_setSqliteName(FMDB_DBName);

#if defined(DEBUG) //内测阶段
	//开启数据库Debug调试模式
	bg_setDebug(YES);
#endif
	DDFileLogger *fileLogger = [DDFileLogger new];
	fileLogger.rollingFrequency = 60 * 60 * 24;
	fileLogger.logFileManager.maximumNumberOfLogFiles = 3;
	[DDLog addLogger:[DDTTYLogger sharedInstance]];
	[DDTTYLogger sharedInstance].colorsEnabled = YES;
}

+ (void)copySearch {
	UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
	if (pasteboard.string.length > 0) {
		SearchView *searchView = [[SearchView alloc] initWithFrame:CGRectMake(0.0, 0.0, ScreenWidth - kQKFitModuleDecimal(120), kQKFitModuleDecimal(75 + 140))];
		[QKShareLiveSheetManager showSearchWithSuperView:ScreenKeyWindow customView:searchView];
	}
}

@end
